package com.zto.wk.homeWeb.controller;

import com.zto.wk.homeWeb.pojo.User;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by wangkuan at 2018-09-25 16:16
 */
@RestController
@RequestMapping("home")
public class HomeController {

    @RequestMapping("{name}")
    public ResponseEntity<User> getUser(@PathVariable String name) {
        return ResponseEntity.ok(new User(name, "unknown", 0));
    }

    @RequestMapping("user")
    public ResponseEntity<User> setUser(String name) {
        return ResponseEntity.ok(new User(name, "ok", 100));
    }
}
